/*
	Written By Pradipna Nepal
	www.pradsprojects.com

	Copyright (C) 2012 Prads Projects
	Please read COPYING.txt included along with this source code for more detail.
	If not included, see http://www.gnu.org/licenses/
*/

#ifndef LIBCODEGENERATION_H
#define LIBCODEGENERATION_H

#include <algorithm>
#include <sstream>
#include <fstream>
#include "libTokenModule.h"
#include "libSymbolTable.h"
#include "libParser.h"
#include "libOptimizer.h"
using namespace std;
using namespace Optimizer;

#define writeToBin(counter, data, bin) {\
	memcpy(&bin[counter], &data, 4);\
	counter += 4;\
}

#define FONT_SIZE			3040	//Font data size in bytes

#define IDENT_NOT_FOUND		0x7FFFFFFF

namespace CodeGenerator {
	void generateCode(const vector<TokenModule> *tMod, const SblTable *sblTable, vector<list<Opcode>> *opMod, unsigned char *binOut, 
		string *startAddress, const char *sourcePath);
}

#endif